package com.flowerplus.store.common.data.utils.glide;

import android.content.Context;

import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.module.GlideModule;
import com.flowerplus.store.App;

import java.io.InputStream;

/**
 * Created by z on.
 * Des:
 * Date: 2017/7/15
 */

public class GlideOkHttpModule implements GlideModule {

    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
        // Do nothing.
    }

    @Override
    public void registerComponents(Context context, Glide glide) {
        glide.register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(App
                .getApp().getApplicationComponent().getOkHttpClient()));
    }


}
